package _00_LianXi._28_LianXi;

public class SubCar extends Car {
	private boolean newEnergy;

	public SubCar(boolean newEnergy) {
		super();
		this.newEnergy = newEnergy;
		this.autopilot(this);
	}

	public SubCar(String brand, int speed, boolean newEnergy) {
		super();
		this.brand = brand;
		this.speed = speed;
		this.newEnergy = newEnergy;
		this.autopilot(this);
	}

	@Override
	public String toString() {
		return "品牌是 : " + brand + " 时速 " + speed + " 是否是新能源 : " + newEnergy;
	}

	// 自动驾驶方法
	public void autopilot(SubCar s) {
		System.out.println(s.brand+" 是自动驾驶 ");
	}
}
